# 导包
from common.base import *


class Admin(Base):

    # admin_url = 'http://172.16.140.91/ecshop/admin/privilege.php?act=login'
    admin_url = 'http://192.168.0.193/ecshop/admin/privilege.php?act=login'

    # 定位关闭广告
    def btn_close(self):
        self.click((By.XPATH, '//*[@id="panelCloud"]/div[1]/span'))

    # 定位请登录 ID cloudLogin
    def btn_login_switch(self):
        self.click((By.ID, 'cloudLogin'))

    # 用户名NAME username
    def ipt_username_admin(self, username):
        self.send_keys((By.NAME, 'username'), username)

    # 密码NAME password
    def ipt_password_admin(self, password):
        self.send_keys((By.NAME, 'password'), password)

    # 登录按钮 CLASS btn-a
    def btn_login_admin(self):
        self.click((By.CLASS_NAME, 'btn-a'))




